package cc.rengu.redp.bizimpl.igas.controller;


import cc.rengu.redp.bizimpl.igas.domain.RRuleCfg;
import cc.rengu.redp.bizimpl.igas.service.RRuleCfgService;
import cc.rengu.redp.common.controller.BaseController;
import cc.rengu.redp.common.domain.QueryRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author 刘玉亮.LL
 */
@Slf4j
@Api(tags = "路由规则管理管理")
@RestController
@RequestMapping("admin/igas/rRuleCfg")
public class RRuleCfgController extends BaseController {
    @Autowired
    private RRuleCfgService rRuleCfgService;


    @GetMapping
//    @RequiresPermissions("areaInfo:view")
    public Map<String, Object> list(QueryRequest request, RRuleCfg entity) {
        return getDataTable(this.rRuleCfgService.findByPage(request, entity));
    }

    @PostMapping(value = "/edit")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "证书索引", required = true, dataType = "String")
    })
    public void editSave(RRuleCfg entity){
        this.rRuleCfgService.saveOrUpdate(entity);
    }
}
